<template>
	<view class="">
		<u-form-item :label="item.label" borderBottom ref="item1">
			<view @click="show = true" style="flex: 1">{{ $z.$t(inputValue) }}</view>
		</u-form-item>
		<u-action-sheet :actions="list" :show="show" @select="select" @close="show = false"></u-action-sheet>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// inputValue: "",
				show: false,
			};
		},
		computed: {
			list() {
				return this.item.option.map((e) => {
					return {
						...e,
						name: e.label,
					};
				});
			},
			inputValue() {
				return (
					this.item.option.find((e) => e.value == this.value)?.label || "请选择"
				);
			},
		},
		props: {
			item: {
				typeof: Object,
				default: () => {
					return {};
				},
			},
			data: {
				typeof: Object,
				default: () => {
					return {};
				},
			},
			value: {
				typeof: [String, Number, Boolean, Array, Object],
				default: () => {
					return "";
				},
			},
		},

		methods: {
			blur() {
				this.$emit("input", this.inputValue);
			},
			select(e) {
				this.$emit("input", e.value);
				this.show = false;
				console.log(e, "111");
			},
		},
	};
</script>

<style></style>